#include <stdlib.h>
#include <stdio.h>
#include "lws_triedict.h"
#include "lws_wordgraph.h"
#include "lws_basicseg.h"

using namespace LWS;

int main(int argc, char *argv[])
{
    if (argc != 4)
    {
	printf("test_basicseg trie_binfile CHAR_file text\n");
	return -1;
    }

    CTrieDict trie_dict;
    if(trie_dict.Load(argv[1], argv[2])) {
	CWordGraph word_graph;

	CBasicSeg basic_seg(&trie_dict);
	basic_seg.Segment(argv[3], &word_graph, true);
	word_graph.Print();
    } else {
	printf("trie dict load fail\n");
	return -1;
    }

    return 0;
}
